<?php
$toolbar    =new ToolBarHelper($act);
$toolbar->setSubmitAjax(true);

$tabsedit   = array("Base","Destinations","Meta","Summary","Full itinerary","Rates");

if($act=="element")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->SetTitle('['.$tour['cName'].' programs]');

    $toolbar->Back(getUrlBack());
    $toolbar->Delete('delcontent');
    $toolbar->Apply();
    $toolbar->addNew('addcontent','New','id='.$id);
}
else if($act=="config")
{
    $toolbar->SetTitle('[Config]');
    $toolbar->Apply();
}
else if($act=="photos")
{
     $toolbar->SetTitle('[Add Photos]');
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
}
else if($act=="addvideo" )
{
    $toolbar->SetTitle('[New Video]');
    $toolbar->Back("?module=$module&opt=video&id=".$video['iParentId']);
    $toolbar->Save('Save',2);
    $toolbar->Save('Save & Exit');
}
else if($act=="editvideo")
{
    $toolbar->SetTitle('[Edit Video]');
    $toolbar->Back("?module=$module&opt=video&id=".$video['iParentId']);
    $toolbar->Apply();
    $toolbar->Save();
}
else if($act=="video")
{
     $toolbar->SetTitle('[Videos]');
    $toolbar->Back(getUrlBack());
    $toolbar->Delete('delvideo');
    $toolbar->Apply();
    $toolbar->addNew('addvideo','New Video','id='.$id);
}
else if($act=="tabs")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->SetTitle('['.$tour['cName'].' Tabs]');

    $toolbar->Back(getUrlBack());
    $toolbar->Delete('deltab');
    $toolbar->Apply();
    $toolbar->addNew('addtab','New','id='.$id);
}
else if($act=="addtab")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->SetTitle('[New Tab]');

    $toolbar->Back("?module=$module&opt=tabs&id=".$tab['iParentId']);
    $toolbar->Save('Save',1);
}
else if($act=="edittab")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->SetTitle('[Edit Tab]');

    $toolbar->Back("?module=$module&opt=tabs&id=".$tab['iParentId']);
    $toolbar->Save('Save',1);
}
else if($act=="addcontent")
{
    $toolbar->setSubmitAjax(false);
    $toolbar->SetTitle( '[New Program]');
    $toolbar->Back("?module=$module&opt=element&id=".$tourelm['iParentId']);
    $toolbar->Save('Save',1);
}
else if($act=="editcontent")
{
    $toolbar->SetTitle('[Edit Program]');
    $toolbar->Back();
    $toolbar->Apply();
    $toolbar->Save();
}
else if($act=="add")
{
    $toolbar->addTab($tabsedit);
    $toolbar->SetTitle('[New Tour]');
    $toolbar->Back(getUrlBack());
    $toolbar->Save('Save',2);
    $toolbar->Save('Save & Exit');
}
else if($act=="edit")
{
    $toolbar->addTab($tabsedit);
    $toolbar->SetTitle('[Edit Tour]' );
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
}else
{
    $toolbar->setSubmitAjax(false);
    $toolbar->Delete();
    $toolbar->Apply();
    $toolbar->addNew('add','New Tour','id='.$id);
}
?>